#ifndef FILAEMR_HPP_
#define FILAEMR_HPP_

#include "BaseQueueE.hpp"

namespace queue
{

	template<class T>
	class FilaEMR : public BaseQeueE<T>
	{

	public:
		
		FilaEMR( const unsigned int );
		
		~FilaEMR();
		
		void
		pop();
		
	private:
		
		void
		shiftLeft();
		
		
	};

}


/***********
 * 		   *
 * Methods *
 * 		   *
 ***********/

//PUBIC methods :P

template<class T>
queue::FilaEMR<T>::FilaEMR( const unsigned int _maxSize )
{
	this->queue.resize( _maxNodes );	
}

template<class T>
queue::FilaEMR<T>::~FilaEMR()
{
	this->clear();
}

template<class T> void
queue::FilaEMR<T>::pop()
{
	if( !this->empty() )
	{
		this->firstNode++;
		
		this->shiftLeft();
	}
	else
	{
		this->throwException("Queue is empty",4);
	}
}

//private method

template<class T> void
queue::FilaEMR::shiftLeft()
{
	if( this->firstNode > 0)
	{
		for( unsigned int counter = this->firstNode ; counter <= this->lastNode ; counter++ )
		{
			this->queue.at(counter - 1) = this->queue.at(counter);
		}
	}
	else
	{
		this->throwException()
	}
}

#endif /*FILAEMR_HPP_*/
